home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-13 / tracefnt.zip / TRACEFNT.SP < prev   
Text File  |  1992-05-15  |  5KB  |  88 lines

  1. Printer QMS800   
  2. STYLE TopMargin  1 inch, BottomMargin 1 inch
  3. STYLE LeftMargin 1 inch, RightMargin  1 inch
  4. STYLE Paper     11 inch, PaperWidth 8.5 inch
  5. STYLE Spread     1 line, WordSpacing  1000  
  6. STYLE JUSTIFY no
  7. BEGIN FOOTERT
  8. @>... / 2
  9. END FOOTERT
  10. BEGIN COMMENT
  11.   ╔═══════════════════════════════════════════════════════════════════════╗
  12.   ║                                                                       ║
  13.   ║                                                                       ║
  14.   ║  Note: This file is formatted to be printed on a PostScript Printer.  ║
  15.   ║                                                                       ║
  16.   ║        Adjust the Printer ... instruction [line 1] above to           ║
  17.   ║        whatever name you use for your own PostScript .SPP driver.     ║
  18.   ║                                                                       ║
  19.   ║                                                                       ║
  20.   ╚═══════════════════════════════════════════════════════════════════════╝
  21. END COMMENT
  22. @tct{"├" "@hsp(0.1 em)"}
  23. @define(mono, font Courier, size 10.5 points, notct)
  24. @macro(trc() = "@mono[@@trace(@_)]")
  25. @center[Creating Outlined Typefaces in Sprint for
  26. PostScript Printers]
  27.  
  28. May 15, 1992 @>Norman Swartz
  29. @>Department of Philosophy
  30. @>Simon Fraser University
  31. @>Burnaby, BC
  32. @>Canada V5A 1S6
  33. @>Fax: (604)-291-4455
  34. @>E-mail: norman_swartz@@sfu.ca
  35.  
  36.  
  37. R 65,T 5,FONT Times, SIZE 12 points, SPACING 13 points
  38. It is a relatively easy matter to create outlined (i.e. hollow)typefaces for a PostScript printer.
  39.  
  40. (1) At  the tail end of the file POSTSCR.TCT add the followingtwo lines:
  41.  
  42. R 0,T 5
  43. @begin(mono)
  44.     @@define(inv, invisible)
  45.     @@macro[trace() = `@@escape<s = "(@@eval)outln ">@@inv(@@eval)']
  46. @end(mono)
  47. R 65,T 5
  48.  
  49. (Note carefully the blankspace immediately after the word"@mono[outln]".)
  50.  
  51. (2) In the file POSTSCR.HDR, immediately before the line reading"@mono[initgraphics]", insert the lines:
  52.  
  53. @begin(mono)
  54.     /outln {gsave true charpath 12.5 setlinewidth
  55.         stroke grestore} bind def
  56. @end(mono)
  57.  
  58. Thereafter, to print a symbol or a word in outline, simply embedthat symbol or word as the argument of the @trc() macro.
  59.  
  60. @bar(1 point)
  61.  
  62. Technical notes:
  63.  
  64. The @trc() macro passes its argument only partially processedover to a PostScript macro, the @mono(outln) macro.  Inparticular, if there are any typeface control instructions, sizechanges, spacing instructions (e.g. "@mono[@@hsp(0.1 em)]"), etc.embedded in the original argument, they will not be processed(indeed they may even end up being printed in outline!).  So ifyou want to do more than simply print a string of characters inthe current font at the current size, you will have to make thechanges outside of the @trc() macro.  Suppose you want to tracethe diamond (char 165@-(octal)├) in the Dingbats font.  You wouldhave to place the font name outside of the @trc() macro, e.g.you'd type"@mono[^OFONTdingbats^N@@trace<@@char(165o)>^OENDF^N]".  (Notethat the @mono[@@char(@_)] macro works correctly inside the@trc() macro.)
  65.  
  66. The same restriction applies to full justification.  To justify aline left and right, Sprint relies on features in the PostScriptinterpreter.  If you use a string of words as the argument to@trc(), the blankspaces between them will not be expanded in afully justified paragraph.  Again, the trick is to have Sprint dothe work outside of the @trc() macro.  E.g. Suppose you wanted"walled city" to print in outline within a fully justifiedparagraph:@nohinge
  67.  
  68. @begin(Text)
  69.     Correct:   @^@mono[@@trace(walled) @@trace(city)]
  70.     Incorrect: @\@mono[@@trace(walled city)]
  71. @end(Text)
  72.  
  73. Specifically, the blankspace would have to occur between twoinvocations of the macro, not as a part of a two-word argument. (You probably would be wise, too, to turn off wordspacing, i.e.use "@mono{@@style[Wordspacing 1000]}".  Of course, if you havefull-justification turned off, i.e. are printing left-justified[as in this very paragraph], you can use strings of words asarguments to the @trc() macro: the blankspaces will printalright, they just won't be expanded.  But you don't wantexpansion in a left-justified paragraph.)
  74.  
  75. Having the means to create an outline of any font allows one tosupplement the Symbols typeface.  Mathematicians and logicianshave long lamented the lack of a hollow box in the Symbol set. It is easy now to create a hollow box.  One need only trace thesolid box in the Dingbats typeface.  To scale it to the correctsize, I use these instructions:
  76.  
  77. @begin(mono)
  78.     @@define{reduce, size 0.6}
  79.     @@define(dngbt, font Dingbats)
  80.     @@tct{"||""@@dngbt[@@reduce(@@trace<@@char[156o]>)]@@hsp(0.15 em)"}
  81. @end(mono)
  82.  
  83. To print the hollow box, I then type "@mono[||]".  If you likeyour hollow boxes larger, change the factor, "0.6", in thedefinition of "reduce" to, e.g., "0.7".
  84.  
  85. The @trc() macro works in different point sizes.  Just be sure tochange the point size outside of the macro, e.g. "@mono[^OSIZE 14POINTS^N@@trace(@_)^OENDS^N]".
  86.  
  87. The thickness of the tracing line on outline typefaces iscontrolled by the numerical parameter preceding "setlinewidth" inthe PostScript definition of "@mono[/outln]".  To make thetracing line thicker increase "@mono[12.5 setlinewidth]" to,e.g., "@mono[15 setlinewidth]".
  88.